package com.gao.mybatis.session;

import com.gao.mybatis.configuration.Configuration;
import com.gao.mybatis.parse.Parser;
import com.gao.mybatis.parse.SqlMapperConfigXmlParser;
import com.gao.mybatis.parse.XmlParser;

import java.io.InputStream;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2020-03-29 17:59
 */
public class SqlSessionFactoryBuilder {

    public static SqlSessionFactory build(InputStream in) throws Exception {
        XmlParser parser = new SqlMapperConfigXmlParser(new Configuration());
        Configuration configuration = parser.parse(in);
        return new DefaultSqlSessionFactory(configuration);
    }


}
